<template>
  <div>
    <div id="main1" style="height: 400px; width: 740px" />
  </div>
</template>

<script>
var echarts = require('echarts')
export default {
  mounted() {
    const myChart = echarts.init(document.getElementById('main1'))
    const option = {
      tooltip: {
        trigger: 'axis',
        axisPointer: {
          type: 'shadow'
        }
      },
      legend: {},
      grid: {
        left: '0%',
        right: '5%',
        bottom: '0%',
        containLabel: true
      },
      xAxis: [
        {
          type: 'category',
          data: ['2015', '2016', '2017', '2018', '2019', '2020', '2021', '2022']
        }
      ],
      yAxis: [
        {
          type: 'value'
        }
      ],
      series: [
        {
          name: '销售数量',
          type: 'bar',
          emphasis: {
            focus: 'series'
          },
          data: [320, 332, 301, 334, 390, 330, 320, 340]
        },
        {
          name: '土地成本',
          type: 'bar',
          stack: 'Ad',
          emphasis: {
            focus: 'series'
          },
          data: [120, 132, 101, 134, 90, 230, 210, 220]
        },
        {
          name: '建筑成本',
          type: 'bar',
          stack: 'Ad',
          emphasis: {
            focus: 'series'
          },
          data: [220, 182, 191, 234, 290, 330, 310, 320]
        },
        {
          name: '配套成本',
          type: 'bar',
          stack: 'Ad',
          emphasis: {
            focus: 'series'
          },
          data: [150, 232, 201, 154, 190, 330, 410, 450]
        },
        {
          name: '销售额',
          type: 'bar',
          data: [862, 1018, 964, 1026, 1679, 1600, 1570, 1650],
          emphasis: {
            focus: 'series'
          },
          markLine: {
            lineStyle: {
              type: 'dashed'
            },
            data: [[{ type: 'min' }, { type: 'max' }]]
          }
        },

        {
          name: '20~30岁潜在客户',
          type: 'bar',
          stack: 'Search Engine',
          emphasis: {
            focus: 'series'
          },
          data: [120, 132, 101, 134, 290, 230, 220, 240]
        },
        {
          name: '30~40岁潜在客户',
          type: 'bar',
          stack: 'Search Engine',
          emphasis: {
            focus: 'series'
          },
          data: [60, 72, 71, 74, 190, 130, 110, 100]
        },
        {
          name: '40岁以上潜在客户',
          type: 'bar',
          stack: 'Search Engine',
          emphasis: {
            focus: 'series'
          },
          data: [62, 82, 91, 84, 109, 110, 120, 130]
        }
      ]
    }

    option && myChart.setOption(option)
  }
}
</script>

<style>

</style>
